[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
fabs() Calculate Absolute Value of Floating-Point Value
#include <math.h>
double fabs(x);
double x; Floating-point value
fabs() returns the absolute value of the double 'x'.
Returns: The absolute value of 'x'. There is no error return.
-------------------------------- Example ---------------------------------
The following statements calculate the absolute values of -15.7, 0.0
and 4.66e-3.
#include <math.h> /* Required for declaration only */
main()
{
double x, y, z;
x = fabs(-15.7); /* x = 15.7 */
y = fabs(0.0); /* y = 0.0 */
z = fabs(4.66e-3); /* z = 4.66e-3 (0.00466) */
}
See Also:
ceil()
fmod()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson